***JOP Kane, Mason, and Wronski****
use "JOP_KMW_Figure1_Qualtrics.dta" file


*********************Figure 1: Average Perceived & Actual Group Allegiances in the American Public************
****Perceived from Qualtrics; Actual from ANES*****

	*2012 *note:  Additional features were adjusted using Graph Editor
scatter PCT_DEMVOTE_2012 PERCEIVED_PARTY2rev, mlabel(GROUP) name(g1,replace) legend(off) ///
ytitle("Percent Voting Democratic (2012)") xtitle("") ///
|| lfit PCT_DEMVOTE_2012 PERCEIVED_PARTY2rev

	*2016 *note:  Additional features were adjusted using Graph Editor
scatter PCT_DEMVOTE_2016 PERCEIVED_PARTY2rev, mlabel(GROUP) name(g2,replace) legend(off) ///
ytitle("Percent Voting Democratic (2012)") xtitle("") ///
|| lfit PCT_DEMVOTE_2016 PERCEIVED_PARTY2rev
 
graph combine g1 g2, ycommon

	**correlations -- all groups
pwcorr PCT_DEMVOTE_2012 PCT_DEMVOTE_2016 PERCEIVED_PARTY2rev, sig star(.05)
	*Democratic Groups Only
pwcorr PCT_DEMVOTE_2012 PCT_DEMVOTE_2016 PERCEIVED_PARTY2rev if group_party==0 , sig star(.05)
	*Republican Groups Only
pwcorr PCT_DEMVOTE_2012 PCT_DEMVOTE_2016 PERCEIVED_PARTY2rev if group_party==1 , sig star(.05)


*********************FIGURE D5.  Group Sentiments and Groups’ Partisan Electoral Behavior************
****Perceived from Qualtrics; Actual from ANES*****
*FIGURE D5:  CORRELATIONS

	*2012
pwcorr PCT_DEMVOTE_2012 BETA_PID01_DtoR, sig // -.82, p<.001

	*2016
pwcorr PCT_DEMVOTE_2016 BETA_PID01_DtoR, sig // -.80, p<.001

*FIGURE D5:  CODE

	*2012 *note:  Additional features were adjusted using Graph Editor
scatter PCT_DEMVOTE_2012 BETA_PID01_DtoR, mlabel(GROUP) scheme(s1mono) legend(off) ///
ytitle("% Voting Democratic (2012)") xtitle("") ///
|| lfit PCT_DEMVOTE_2012 BETA_PID01_DtoR, lcolor(red)

	*2016 *note:  Additional features were adjusted using Graph Editor
scatter PCT_DEMVOTE_2016 BETA_PID01_DtoR, mlabel(GROUP) scheme(s1mono) legend(off) ///
ytitle("% Voting Democratic (2012)") xtitle("") ///
|| lfit PCT_DEMVOTE_2016 BETA_PID01_DtoR, lcolor(red)
